package com.cskaoyan.mapper;

import com.cskaoyan.bean.User;
import com.cskaoyan.bean.UserExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);
    //根据username 查询 其 password (username 是 unique 的 所以String 接收即可)
    String selectPasswordByName(@Param("username") String username);

    //根据username 查询 其 avatar
    String selectAvatarUrlByName(String username);
    //根据username 查询 其 id
    Integer selectIdByName(String username);

    //根据username 查询 User
    User selectUserByName(@Param("username") String username);
    //修改密码
   // int updatePassword(@Param("mobile") String mobile, @Param("password") String password);


}